package com.loansystem.controller.socket;

import com.loansystem.bean.user.User;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class JumpController {

    @RequestMapping("/toSocket")
    public String toSocket() {
        return "socket/websocket";
    }

    @RequestMapping("/getUserInfo")
    @ResponseBody
    public User getUserInfo() {
        User user = (User) SecurityUtils.getSubject().getPrincipal();
        return user;
    }

}
